package com.woniu.mall.controller;

import com.woniu.common.entity.Result;
import com.woniu.mall.VO.CommentVO;
import com.woniu.mall.VO.ProductListVO;
import com.woniu.mall.pojo.MallComment;
import com.woniu.mall.service.IMallCommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 坤
 * @since 2023-05-22
 */
@RestController
@RequestMapping("/mallComment")
@Api(tags = "评论管理")
public class MallCommentController {
    @Autowired
    private IMallCommentService commentService;

    @ApiOperation("评论列表")
    @GetMapping("/listComment/{pid}")
    public Result listComment(@PathVariable String pid) {
        List<CommentVO> commentVOList = commentService.listComment(pid);
        return Result.ok(commentVOList);
    }
}
